package cn.iocoder.yudao.module.shop.dal.mysql.variable;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.shop.dal.dataobject.variable.ShopVariableDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.shop.controller.admin.variable.vo.*;

/**
 * 零散变量 Mapper
 *
 * @author 曹建伟
 */
@Mapper
public interface ShopVariableMapper extends BaseMapperX<ShopVariableDO> {

    default PageResult<ShopVariableDO> selectPage(ShopVariablePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ShopVariableDO>()
                .betweenIfPresent(ShopVariableDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(ShopVariableDO::getId));
    }

    default List<ShopVariableDO> selectList(ShopVariableExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<ShopVariableDO>()
                .betweenIfPresent(ShopVariableDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(ShopVariableDO::getId));
    }

}
